﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WYSIWYGControl.ascx.cs" Inherits="WebWYSIWYG.controls.WysiwygControl" %>

<!-- jQuery and jQuery UI -->
	<script src="../elrte-1.2/js/jquery-1.4.4.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../elrte-1.2/js/jquery-ui-1.8.7.custom.min.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="../elrte-1.2/css/smoothness/jquery-ui-1.8.7.custom.css" type="text/css" media="screen" charset="utf-8"/>
	<!-- elRTE -->
	<script src="../elrte-1.2/js/elrte.full.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="../elrte-1.2/css/elrte.full.css" type="text/css" media="screen" charset="utf-8"/>
	<!-- elRTE translation messages -->
	<script src="../elrte-1.2/js/i18n/elrte.ru.js" type="text/javascript" charset="utf-8"></script>

    <!-- Made in Siberia -->
	<link href="../wysiwyg.css" rel="stylesheet" type="text/css"/>
	<script src="../wysiwyg.js" type="text/javascript" charset="utf-8"></script>
	
	<script type="text/javascript">
	    var editor;
	    $().ready(function() {
	        var opts = {
	            cssClass: 'el-rte',
	            height: 600,
	            //width: 960,
	            toolbar: 'complete',
	            cssfiles: ['css/elrte-inner.css']
	        }	        
	        editor = new elRTE($('#editor').get(0), opts)
	    })

	    function SetDivHidden() {	       
	        var divVal = editor.getSource();
	        document.getElementById('divHidden').value = divVal;
	        alert("[" + document.getElementById('divHidden').value + "]");	        
	    }

	</script>
	
<div id="wysiwyg">
    <div id="richTextEditor">        
        <form id="Form1" runat="server">
            <div id="editor" >
                <%Response.Write(HTMLtext);%>
            </div>
            <div id ="buttons">
                <input type="button" id="SetButton" onclick="SetDivHidden();" value="SET"/>        
                <asp:Button ID="SaveButton" runat="server" onclick="ClickSave" Text="SAVE" width="140px" height="40px"/>
            </div>
            <input type="hidden" id ="divHidden" name="divHidden" value=""/>
        </form> 
    </div>
</div>

